package com.qin.springcloud.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.qin.springcloud.bean.Users;
import com.qin.springcloud.service.UserClientService;

@RestController
public class UsersConsumerController {

	@Autowired
	private UserClientService userClientService;

	// https://blog.csdn.net/weixin_43732955/article/details/93976312
	@RequestMapping("/consumer/get/{id}")
	public Users getById(@PathVariable(value="id") int id) {
		System.out.println(userClientService.getClass());
		return this.userClientService.getById(id);

	}

	@RequestMapping("/consumer/getAll")
	public List<Users> getAll() {
		System.out.println(userClientService.getClass());
		return this.userClientService.getListAll();
	}

	@RequestMapping("/consumer/get")
	public int get() {
		return 2;

	}
}
